import 'package:cbec_app/components/base/base_image.dart';
import 'package:cbec_app/components/base/base_interactive.dart';
import 'package:cbec_app/components/common/common_style.dart';
import 'package:cbec_app/routes/routes.dart';
import 'package:cbec_app/utils/AppData.dart';
import 'package:cbec_app/utils/GlobalData.dart';
import 'package:cbec_app/utils/ThemeConfig.dart';
import 'package:cbec_app/utils/logger.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

///快捷登录组件
class FastLogin extends StatelessWidget {
  const FastLogin({super.key});

  Widget build(BuildContext context) {
    return Positioned(
        left: 0,
        bottom: MediaQuery.of(context).padding.bottom,
        child: Container(
          width: 375.w,
          height: 40.h,
          color: ThemeConfig.boldTextColor.withOpacity(0.5),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Row(
                children: [
                  Padding(
                    padding: EdgeInsets.only(left: 8.w),
                    child: BaseImage(
                      url: 'login_logo.png',
                      width: 28,
                      height: 28,
                    ),
                  ),
                  Padding(
                    padding: EdgeInsets.only(left: 4),
                    child: Text(
                      '登录购买全球好货',
                      style: setTextStyle(14, FontWeight.w400, Colors.white),
                    ),
                  )
                ],
              ),
              BaseInteractive(
                childWidget: Container(
                  width: 80.w,
                  height: 34.h,
                  margin: EdgeInsets.only(right: 8.w),
                  decoration: BoxDecoration(
                      color: ThemeConfig.themeColor,
                      borderRadius: BorderRadius.all(Radius.circular(54))),
                  alignment: Alignment.center,
                  child: Text(
                    '立即登录',
                    style: setTextStyle(12, FontWeight.w500, Colors.white),
                  ),
                ),
                onClick: () {
                  Get.toNamed(Routes.login);
                },
              )
            ],
          ),
        ));
  }

  @override
  String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
    super.toString();
    return 'Positioned';
  }
}
